public class text3_4 {
   public static void main (String args[]) {
     double sum=0,item=1;
     int n=20;
      for(int i=1;i<=n;i++) {
      item=item*(1.0/i);
      sum=sum+item;
      }
     System.out.println("sum="+sum);
   }
}
